package gspushmq.model;

import com.google.common.collect.Lists;
import gspushmq.util.StringUtil;

import java.util.List;

/**
 * @Description 临时维护requestId表，下版本废弃requestId，采用mqSubType，前端联调
 * @Author 成尚佳
 * @Date 2019/1/16 10:23
 * @Version 1.0
 * @company 上海朝阳永续信息技术有限公司
 * @copyright (c) 2015 SunTime Co'Ltd Inc. All rights reserved.
 **/
public enum TempRequestIdEnum {
    //1.tags标签异动
    TAGS("tags","msg_private_tags"),

    //2.warn行情预警
    WARN("warn","msg_warningSet&add"),

    //3.脱水研报
    YB("dehydration_report","msg_news"),
    //4.要问
    IMNEWS("important_news","msg_news"),
    //5.内参
    INREFE("internal_reference","msg_news"),

    //6.系统活动
    FINCITY("fincity","msg_activity"),

    //7.360周报
    WREPORT("wreport_360","msg_360_week"),

    //8.vip实战股票池
    STOCKVIP("stock_vip","msg_stock_pool"),

    //9.直播
    LIVEVIDO("live_broadcast","msg_live"),
    //10.预约
    PREVIDEO("live_reservation","msg_pre_live"),
    //11.录播
    OLDVIDEO("live_recorde","msg_record");




    public static String getRequestId(String mqSubType){
        if (mqSubType == null ){
            return null;
        }
        for (TempRequestIdEnum tempRequestIdEnum :TempRequestIdEnum.values()){
            if (tempRequestIdEnum.getMqSubType().equalsIgnoreCase(mqSubType)){
                return tempRequestIdEnum.getRequestId();
            }
        }
        return null;
    }


    public static List<String>  getMqSubTypes(){
        List<String> list = Lists.newArrayList();
        for (TempRequestIdEnum tempRequestIdEnum : TempRequestIdEnum.values()){
            list.add(tempRequestIdEnum.getMqSubType());
        }
        return list;
    }

    //#define MSG_REQUEST_TYPE_SYS_NOTICE			   "msg_sys"						//系统通知
    //#define MSG_REQUEST_TYPE_LIVE				   "msg_live"						//直播消息
    //#define MSG_REQUEST_TYPE_PRE_LIVE			   "msg_pre_live"					//直播预约
    //#define MSG_REQUEST_TYPE_RECORD     		   "msg_record"						//录播
    //#define MSG_REQUEST_TYPE_AI_TRACE			   "msg_ai_trace"					//ai追踪
    //#define MSG_REQUEST_TYPE_LOGIN				   "msg_login"						//登录
    //#define MSG_REQUEST_TYPE_ACTIVITY			   "msg_activity"					//活动消息
    //#define MSG_REQUEST_TYPE_360_WEEK			   "msg_360_week"					//自选股360周报
    //#define MSG_REQUSET_TYPE_STOCK_POOL			   "msg_stock_pool"					//实战股票池
    //#define MSG_REQUSET_TYPE_UPDATE				   "msg_update"						//token更新
    //#define MSG_REQUSET_TYPE_NEWS				   "msg_news"						//要闻订阅  内参订阅
    //#define MSG_REQUSET_TYPE_WARNING			   "msg_warningSet"					//闪电预警

    /**
    * 消息子类型
    *
    */
    String mqSubType;
    /**
    * 前端request_id
    *
    */
    String requestId;


    TempRequestIdEnum(String mqSubType, String requestId) {
        this.mqSubType = mqSubType;
        this.requestId = requestId;
    }

    public String getMqSubType() {
        return mqSubType;
    }

    public void setMqSubType(String mqSubType) {
        this.mqSubType = mqSubType;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }
}
